You are here: Trading System Programming > Reference > Classes > TechnicalAnalysis > TechnicalAnalysis Methods > AD

AD

This method calculates Chaikin A/D Line.

 

Syntax

var AD(highPricesArray, lowPricesArray, closePricesArray, volumeArray, calculatedDataArray);

Parameters

highPricesArray

Array object filled with high prices.

 

lowPricesArray

Array object filled with low prices.

 

closePricesArray

Array object filled with close prices.

 

volumeArray

Array object filled with volume prices.

 

calculatedDataArray

Empty Array object that will be filled with calculated data.

Return Value

Returns true if calculation was completed successfully, or false otherwise.

Example

The following example demonstrates how to use AD method.

 

function calculate(beginIndex, endIndex)

{

var openPricesArray = new Array();

var highPricesArray = new Array();

var lowPricesArray = new Array();

var closePricesArray = new Array();

var volumeArray = new Array();

 

//populate arrays..

..

..

..

 

var calculatedDataArray = new Array();

 

var rc = TechnicalAnalysis.AD(openPricesArray, highPricesArray, lowPricesArray,

closePricesArray, volumeArray, calculatedDataArray);

}

 

 


Copyright © 2006-2009 ActiveTick LLC